package com.ngovanhau.justsort.util;

import android.app.Activity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;

public class UtilActivity {
	public static void requestWindowFeature(Activity ac) {
		ac.requestWindowFeature(Window.FEATURE_NO_TITLE);
		ac.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN);
	}

	public static void resizeDialog(View v, Activity mActivity) {
		int wW = mActivity.getWindowManager().getDefaultDisplay().getWidth();
		int newW = (int) wW;
		int newH = newW * v.getLayoutParams().height
				/ v.getLayoutParams().width;
		v.getLayoutParams().width = newW;
		v.getLayoutParams().height = newW;
	}
	
	public static int getRandomIndex(int min, int max) {
        return (int) (Math.random() * (max - min + 1)) + min;
    }
}
